package com.neusoft.elmboot.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.neusoft.elmboot.po.User;

import java.util.List;

@Mapper
public interface UserMapper {
	@Select("select * from user where userId=#{userId} and password=#{password}")
	public User getUserByIdByPass(User user);

	@Select("select * from user where userId=#{userId}")
	public User getUserById(String userId);

	@Insert("insert into user values(#{userId},#{password},#{userName},#{userSex},null,1)")
	public int saveUser(User user);

	@Select("select * from user")
	List<User> getAll();

	@Delete("delete from user where userId = #{id}")
	Integer deleteById(Integer id);
}
